﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MoqContrib.AutoMock.CommonServiceLocator
{
    /// <summary>
    /// 
    /// </summary>
    public class AutoMockHelper : AutoMock.AutoMockHelper
    {
		private ClassAnalyzer _analyzer;

		internal AutoMockHelper(ClassAnalyzer analyzer)
		{
			_analyzer = analyzer;
			analyzer.Helper = this;
		}

		/// <summary>
		/// Default constructor
		/// </summary>
		public AutoMockHelper()
			:this(new ClassAnalyzer())
		{
		}

        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <param name="instance"></param>
        protected override void RegisterInstance(Type type, object instance)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        /// <param name="key"></param>
        /// <param name="instance"></param>
        protected override void RegisterInstance(Type type, string key, object instance)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="services"></param>
        /// <param name="instance"></param>
        protected override void RegisterInstance(Type[] services, object instance)
        {
        }

		/// <summary>
		/// 
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <returns></returns>
		public override T CreateTestSubject<T>()
		{
			return _analyzer.Construct<T>();
		}
    }
}
